package com.ckn.enums;

import lombok.Getter;

import java.util.Arrays;

/**
 * @Author chenkangning
 * @Date 2024/6/14 10:31
 */
@Getter
public enum PayEnumStrategy {

    ALIBABA("alibaba","alibabaPay"),
    WEI_XIN("weixin","weiXinPay");

    PayEnumStrategy(String code, String beanName) {
        this.code = code;
        this.beanName = beanName;
    }

    private final String code;

    private final String beanName;

    public static PayEnumStrategy getPaymentEnums(String code){
        return Arrays.stream(PayEnumStrategy.values()).filter(pay -> pay.code.equals(code)).findFirst().orElse(null);
    }
}
